/*
 * Copyright (c) 2020, China Mobile Communications Group Co.,Ltd.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-12-09     cmcc       the first version
 */
#ifndef NINESKY_TEXT_SEMANTIC_TEXT_SEMANTIC_H_
#define NINESKY_TEXT_SEMANTIC_TEXT_SEMANTIC_H_

#define URL_CHN_ENG_TRANS "http://aiaas.cmri.cn:8080/cse/api1/chinese_english_translation?"
#define URL_ENG_CHN_TRANS "http://aiaas.cmri.cn:8080/cse/api1/english_chinese_translation?"
#define URL_TEXT_CLASSFY "http://aiaas.cmri.cn:8080/cse/api1/text_classifier?"
#define URL_TEXT_KEYWORD "http://aiaas.cmri.cn:8080/cse/api1/keywords_extraction?"

//text translation
#define MAX_TEXT_LENGTH 1500
typedef struct
{
    char *translateResult;
} NS_Text_Translation;

enum TEXT_TRANSLATE_TYPE
{
    NS_TRANS_CHN_TO_ENG,
    NS_TRANS_ENG_TO_CHN
};

typedef struct
{
    char *kind;
} NS_Text_Classification;

typedef struct
{
    char *word;
    float weight;
} NS_Keyword_Item;

typedef struct
{
    int keywordNumber;
    NS_Keyword_Item *items;
} NS_Text_Keyword;

/**
 * Text translation.
 */
int ns_text_translation(char *token, char *content, enum TEXT_TRANSLATE_TYPE type, NS_Text_Translation *result);

/**
 * Text classification.
 */
int ns_text_classification(char *token, char *content, NS_Text_Classification *result);

/**
 * Text keywords.
 */
int ns_text_keyword(char *token, char *content, NS_Text_Keyword *result);

#endif /* NINESKY_TEXT_SEMANTIC_TEXT_SEMANTIC_H_ */
